package com.protocols.sctp.m3ua.sccp.tcap.camel;

public class SubscriberBalanceConsumer extends Thread{
	
	private Boolean Continue=true;
	private int Balance=0;
	
	public SubscriberBalanceConsumer(SubscriberHandler sub){
		Balance=sub.Balance;
	}
	
	public void run()
    {
		
		while (Balance>0 && Continue){
			try {
				Thread.sleep(1000);
				
				Balance--;
				
			} catch (InterruptedException e) {
				
			}
		
		}
		
		if (Balance==0){
			// Send the Camel Release
		}
		
		
		
    }
	
	public void terminate(){
		Continue=false;
	}

}
